@extends('layouts.app')
@section('title')
    {{ config('app.name') }}
@stop
@section('body')
    <!-- Navigation -->
    @include('home.blocks.nav')
    <!-- Page Header -->
    @include('home.blocks.header')
    <!-- Main Content -->
    <div class="container">
        <div class="row">
            <div class="col-lg-8 offset-lg-2 col-md-10 offset-md-1">
                @foreach($items as $k=>$item)
                    @if($k)
                        <hr>
                    @endif
                    <div class="post-preview">
                        <a href="{{ url('view', ['aid'=>$item->aid]) }}">
                            <h2 class="post-title">{{ $item->title }}</h2>
                            <h3 class="post-subtitle">
                                {{ $item->description }}
                            </h3>
                        </a>
                        <p class="post-meta">{{ $item->updated_at }}发布</p>
                    </div>
                @endforeach
                    <hr>
                    <!-- Pager -->
                    <div class="clearfix">
                        @if($items->currentPage() > 1)
                            <a class="btn btn-secondary float-left" href="{{ $items->previousPageUrl() }}">上一页 &rarr;</a>
                        @endif
                        @if($items->currentPage() < $items->lastPage())
                            <a class="btn btn-secondary float-right" href="{{ $items->nextPageUrl() }}">下一页 &rarr;</a>
                        @endif
                    </div>
            </div>
        </div>
    </div>
    <!-- Footer -->
    @include('home.blocks.footer')
@stop
